Q: Why do my programs display the ReportMessage window without cause?
When you convert a design window into a grid function and callback function, GuiDesigner puts

XuiReportMessage (grid, message, v0, v1, v2, v3, kid, r1)

at the top of the callback function.  Whenever the callback function receives a message, the ReportMessage window appears and displays the message arguments. Remove or disable this line to stop this window from appearing.

Q: Why aren't EXTERNAL variables visible between programs?
EXTERNAL variables are shared between statically linked programs, not libraries.  In other words, if three programs declare EXTERNAL trouble, and the object files of the three programs are linked together into a single executable, a single trouble variable is referenced by all three programs, and trouble is therefore shared by all three programs.   The executable can be a .EXE or a .DLL .

If three programs are linked into three executables, however, all three programs has its own trouble .

Q: Why is XuiSendMessage (g, #SetImage, 0, 0, 0, 0, 0, @dir$ + "my.bmp") an error?
You can only pass individual variables or arrays by reference, never expressions.   The last argument can be @dir$ or @"my.bmp" , but not @dir$ + "my.bmp" . Try:

XuiSendMessage (g, #SetImage, 0, 0, 0, 0, 0, dir$ + "my.bmp") .

Q: Why doesn't XstSleep() sleep when my programs runs on Windows 3.1?
To implement XstSleep() , the standard library calls the Windows API Sleep().  Under WindowsNT, Sleep() works as expected.  Under Windows 3.1, however, Sleep() only sleeps if other processes are actively executing instructions.  To make XstSleep() sleep for the requested time, it calls Sleep() repeatedly until the actual elapsed time equals or exceeds the requested sleep.